﻿#region Using Directives

using System;
using Csla;

#endregion

namespace MarketPulse.BusinessLogic.Common.Criteria
{
    /// <summary>
    /// Criteria class specifying the criteria allowable for a search for a Visit object
    /// </summary>
    [Serializable]
    public class VisitSearchCriteria : CriteriaBase<VisitSearchCriteria>
    {
        #region Enumerations

            /// <summary>
            /// Enumeration used to determine whether sort option to be used
            /// </summary>
            public enum SortOptions
            {
                Default = 0,    //sort by Round Start Date, Branch Name           
                ClientName = 1,
                VisitName = 2,
                BranchName = 3,
                Status = 4,
                ValidDateTime = 5,
                AssignedUser = 6,
                PlannedDateTime = 7,
                RoundLabel = 8
            }

            /// <summary>
            /// Enumeration used to determine the action taken when preparing
            /// a visit for a revisit. *CURRENTLY UNUSED*
            /// </summary>
            public enum SortDirection
            {
                Ascending = 0,
                Descending = 1
            }

        #endregion

        #region Constructors

            /// <summary>
            /// Default constructor for this class
            /// </summary>
            /// <param name="visitGuid">The Guid of the Visit to associate with this criteria</param>                     
            public VisitSearchCriteria(){}
        
            /// <summary>
            /// Overloaded constructor for this class that accepts extra parameters 
            /// </summary>                
            public VisitSearchCriteria(Guid? countryGuid, 
                                 Guid? clientGuid, 
                                 Guid? visitStatusTypeGuid, 
                                 Guid? branchGuid, 
                                 Guid? roundGuid,
                                 int? sortOption = 0,
                                 bool? sortDescending = false,
                                 int? pageSize = 10,
                                 int? pageNumber = 1,
                                 int? pageCount = 0)
            {
                CountryGUID = countryGuid;
                ClientGUID = clientGuid;
                VisitStatusTypeGUID = visitStatusTypeGuid;
                BranchGUID = branchGuid;
                RoundGUID = roundGuid;
                SortOption = sortOption;
                SortDescending = sortDescending;
                PageSize = pageSize;
                PageNumber = pageNumber;
                PageCount = pageCount;
            }

        #endregion

        #region Properties

            public Guid? CountryGUID { get; set; }
            public Guid? ClientGUID { get; set; }
            public Guid? VisitStatusTypeGUID { get; set; }
            public Guid? RoundGUID { get; set; }
            public Guid? BranchGUID { get; set; }

            public int? SortOption { get; set; }
            public bool? SortDescending { get; set; }
            public int? PageNumber { get; set; }
            public int? PageSize { get; set; }
            public int? PageCount { get; set; }

        #endregion

    }
}
